/*
 * @lc app=leetcode.cn id=492 lang=typescript
 *
 * [492] 构造矩形
 */

// @lc code=start
function constructRectangle(area: number): number[] {
    const mid = Math.floor(Math.sqrt(area));
    let i = mid;
    while (i > 0) {
        const l = area / i;
        if (l % 1 === 0) {
            return [l, i];
        }
        i--;
    }
    return [area, 1];
}
// @lc code=end
